package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     *
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getUserByOpenid(String openid);

    /**
     * 新增用户
     * @param user
     */
    void insert(User user);


    /**
     * 统计用户总数量
     * @param totalBeginTime
     * @return
     */
    Integer totalCount(@Param("beginTime") LocalDateTime totalBeginTime);

    /**
     * 查询每日新用户数
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
